<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function wrap() {
        function inner() {
            console.log("inner")
        }

        return inner;
    }

    var inner = wrap();
    inner()
</script>
</html>